package com.vcredit.creditcat.enumtype;

/**
 * 学历转换统一枚举
 */
public enum CommonEducationConvertEnum {
	MASTER(1, 4, "硕士及以上"), 
	UNDERGRADUATE(2, 3, "大学本科"), 
	JUNIOR(3, 2, "大专"),
	SPECIAL(4, 1, "中专"), 
	SENIOR(5, 1, "高中及以下");	
	
	private Integer scode; // 信用猫中学历code
	private Integer tcode; // 外部产品学历code
	private String desc; // 学历描述
	
	private CommonEducationConvertEnum(Integer scode, Integer tcode, String desc) {
		this.scode = scode;
		this.tcode = tcode;
		this.desc = desc;
	}
	public Integer getScode() {
		return scode;
	}
	public Integer getTcode() {
		return tcode;
	}
	public String getDesc() {
		return desc;
	}
	
	public static Integer getTcodeByScode(Integer scode) {
		for(CommonEducationConvertEnum educationEnum : CommonEducationConvertEnum.values()) {
			if(educationEnum.getScode() == scode) {
				return educationEnum.getTcode();
			}
		}
		return 0;
	}
}
